<template>
	<view>
		<view class="share flex justify-center align-center">
			<button class="share-btn" @click="shareFriend" open-type="share">
				<text class="iconfont iconfenxiang"></text>
			</button >
			<button  class="share-btn" @click="shareAll"  >
				<text class="iconfont iconpengyouquan"></text>
			</button >
			<button  class="share-btn" @click="thanks">
				<text class="iconfont iconxihuan"></text>
			</button >
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props:{
			article:{},
		},
		methods: {
			shareFriend(){
				let path = "/pages/home/article_content/article_content";
				if(this.article.type == 2){
					path = "/pages/home/novel_content/novel_content";
				}
				if(this.article.type == 3){
					path = "/pages/home/poetry_content/poetry_content";
				}
				uni.share({
				    provider: 'weixin',
				    scene: "WXSceneSession",
				    type: 0,
				    imageUrl: this.article.cover,
				    title: this.article.title,
				    miniProgram: {
				        id: 'wxf2618059ce7f0d9c',
				        path: path+"?id="+this.article.id
				    }
				});
			},
			shareAll(){
				this.$u.toast('请点击右上角 ... 符号进行分享>>>');
			},
			thanks(){
				let imgArr = ["https://cdn.jy520.fun/superbed/2020/12/12/5fd43a253ffa7d37b3b2fd64.png"]
				uni.previewImage({
					urls: imgArr,
					current: imgArr[0]
				});
			}
		}
	}
</script>

<style lang="stylus">
.share
	border-top 1rpx solid #f7f7f7 
	border-bottom 1rpx solid #f7f7f7 
	.share-btn
		width 60rpx
		height 60rpx
		background #b6b6b6
		margin 30rpx 40rpx
		display flex
		justify-content center
		align-items center
		border-radius 50% 
		text
			color #fff
			font-size 36rpx
</style>
